y <- as.data.frame(y)
gene2module <- read.table("/Volumes/FileManage/0660Drive/02.heterosis_project/08133BtGroup/03.WGCNA/fiber_result/fiber_Gene2module.xls",
           header = T, sep = "\t")
y$GID = rownames(y)
MMcolor = "yellow"
module <- left_join(filter(gene2module,Module == MMcolor),y,
                  by = "GID")
head(module)

plotdata <- data.frame(row.names = module$GID,
                       module[,-c(1,2)])


a = gsub("_.*","",colnames(plotdata))
annotation_col = data.frame(row.names = colnames(plotdata),
                            group = factor(a,levels = c("Bt","BtJ","BtSY","J","SY")))
pheatmap(plotdata,annotation_col = annotation_col,
         scale = "row",show_rownames = F,
         color = colorRampPalette(colors = c("blue","white","red"))(100))
